/////////////////////////////////////////////////////////////////////////////////////////////
// Filename: Rect.h
// 
// Point: Defines a point by it's X and Y coordinates. Coordinates can be stored as
//			floats or as ints.
//
// Rect: Defines a rectangle by its upper-left and lower-right points.
//
// (c) Dave Ottley, 2012. All rights reserved.
/////////////////////////////////////////////////////////////////////////////////////////////
#ifndef RECT_H
#define RECT_H

///////////////////////////
//		INCLUDES
///////////////////////////
#include <stdint.h>
#include <memory.h>

///////////////////////////
//		MY INCLUDES
///////////////////////////

union Coord1D
{
	float asFloat;
	uint32_t asInt;

	Coord1D() { memset(this, 0, sizeof(Coord1D) ); }
	Coord1D(float val) { asFloat = val; }
	Coord1D(int val) { asInt = val; }
};

class Point
{
public:
	Coord1D x, y;

	Point(Coord1D initX = 0, Coord1D initY = 0 ) { x = initX; y = initY; }
};
	
class Rect
{
public:
	Point mUpperLeft;
	Coord1D mWidth;
	Coord1D mHeight;

	Rect(Point upperLeft, Coord1D width, Coord1D height) { mUpperLeft = upperLeft; mWidth = width; mHeight = height; }
};

#endif RECT_H